<template>
  <div>
    <TopBar title="首页"></TopBar>
    <div class="wrapper">
      <image :src="'logo.jpg' | getUrl" class="logo" />
      <text class="greeting">远界</text>
      <text class="message">欢迎进入小远的世界</text>
      <div @click="jump('/menu')"><text>点击进入</text></div>
    </div>
  </div>
</template>

<script>
import TopBar from '@/components/TopBar'
export default {
  name: 'HelloWorld',
  components: { TopBar },
  methods: {
    jump (to) {
      console.log('to=' + to)
      if (this.$router) {
        this.$router.push(to)
      }
    }
  },
  filters: {
    getUrl (str) {
      if (weex.config.env.platform === 'Web') {
        return './web/assets/' + str
      } else {
        return 'local:///' + str.split('.')[0]
      }
    }
  }
}
</script>

<style scoped>
  .wrapper {
    margin-top: 300px;
    justify-content: center;
    align-items: center;
  }
  .logo {
    width: 424px;
    height: 424px;
  }
  .greeting {
    text-align: center;
    margin-top: 70px;
    font-size: 50px;
    color: #41B883;
    width: 424px;
  }
  .message {
    margin: 30px;
    font-size: 32px;
    color: #727272;
  }
</style>
